<script setup>
import { listApi} from '@/api/book'
import { ref, onMounted } from 'vue';

const books = ref({})

onMounted(() => {
    listApi().then(res => {
        books.value = res.data
        
    })
})
</script>

<template>
  <table border>
    <thead>
        <tr>
            <td>id</td>
            <td>name</td>
            <td>author</td>
            <td>isno</td>
        </tr>
    </thead>
    <tbody>
        <tr v-for="item, i in books" :key="i">
            <td>{{ item.id }}</td>
            <td>{{ item.name }}</td>
            <td>{{ item.author }}</td>
            <td>{{ item.isno }}</td>
        </tr>
    </tbody>
  </table>
</template>